const WXAPI = require("apifm-wxapi");
const TOOLS = require("../../utils/tools.js");
const AUTH = require("../../utils/auth");
import Poster from "wxa-plugin-canvas/poster/poster";
import { Base64 } from 'mm.js';

const APP = getApp();

let col1H = 0;
let col2H = 0;

Page({
  data: {
    tf: false,
    yid: "",
    loadingx: false,
    myvip: 0,
    gxsl: 50,
    bxs: false,
    vtt: false,
    sjc: Date.parse(new Date()),
    scrollTop: 0,
    bnavHeight: APP.globalData.bnavHeight,
    navHeight: APP.globalData.navHeight,
    lc1: "",
    f2hh: 1000,
    page: 0,

    scrollH: 0,
    imgWidth: 0,
    loadingCount: 0,
    images: [],
    col1: [],
    col2: [],

    ddl: false,
    my: false,
    type: undefined,
    listfootimg: undefined,
    listfoota: undefined,

    tag1: "",
    tag2: "",
    aislogo: true,
    jdy: {},
    dm: false,
    newfoota: undefined,

  },
  go(e) {
    wx.navigateTo({
      url: `/pages/taglist/index?id=${e.currentTarget.dataset.id}`
    });
  },

  isShow: function (ls) {
    // console.log("22222",this.data.tagname);
    //   console.log("11111111111111111111111",ls);
    let a = false;
    let lsa = ls.split("、");

    let that = this;
    lsa.forEach(function (e) {
      if (e.toLowerCase() == that.data.tagname.toLowerCase()) {
        a = true;
      }
    });
    return a;
  },
  fanhui() {
    wx.navigateBack();
  },
  tovip(e) {
    let id = e.currentTarget.dataset.id;
    // console.log("sssssssssssss",id);
    wx.setStorageSync("vipid", id - 1);

    wx.switchTab({
      url: "/pages/coupons/hy",
    });
  },


  tofvip(e) {
    let id = e.currentTarget.dataset.id;
    console.log("sssssssssssss", id);
    if (id == 1) {
      this.setData({
        tf: true,
      });

    } else {
      wx.setStorageSync("vipid", id);

      wx.switchTab({
        url: "/pages/coupons/hy",
      });
    }

  },
  closeTF() {
    this.setData({
      tf: false,
    });
  },

  async tooliebiao(e) {
    let tag_id = e.currentTarget.dataset.id;
    let type = e.currentTarget.dataset.type;
    let index = e.currentTarget.dataset.index;

    if (tag_id == "互动" || tag_id == "名片" || tag_id == "联系" || tag_id == "联系我们") {
      wx.navigateTo({
        url: "/pages/dm/dm?id=" + this.data.yid,
      })
    }

    if (type == "d1") {
      this.setData({
        tag1: tag_id,
        gxsl: 10,
      });

      // 顶部点击
      this.tagxx(this.data.top[index], "d1");
      tag_id = this.data.topa[index];
    } else if (type == "d2") {
      this.setData({
        tag2: tag_id,
        gxsl: 10,
      });
      // 左侧点击
      this.tagxx(this.data.r[index]);
      tag_id = this.data.ra[index];
    } else {
      this.setData({
        gxsl: 10,
      });
      // 文章点击
      tag_id = e.currentTarget.dataset.id;
      this.tagxx(this.data.tagname);
    }

    this.setData({
      tagname: tag_id,
      page: 0,
      loadingCount: 0,
      images: [],
      col1: [],
      col2: [],
      ddl: false,
      my: false,
      type: type,
    });

    this.loadImages();
  },

  async onLoad(e) {
    const app = getApp();
    let res = await WXAPI.userDetail(wx.getStorageSync("token"));

    if (res.data.userLevel) {
      this.setData({
        myvip: res.data.userLevel.level,
      });
    }
    console.log("userDetail", res, this.data.myvip);
    let that = this;
    if (e && e.scene) {
      const scene = decodeURIComponent(e.scene); // 处理扫码进商品详情页面的逻辑
      console.log("efxz111", scene.split(",")[0]);
      e.id = this.base64EncodeUsingAPI2(scene.split(",")[0]);
      // let efxz = scene.split(",")[1];
      console.log("efxz", e.id);

      that.setData({
        wzid: e.id,
        yid: e.id,
        // fxz: efxz,
      });
    }

    that.setData({
      yid: e.id,
      tagname: e.id,
      mrid: e.id,
      tag1: e.id,
      tag2: e.id,
    });

    // console.log("dddd",e.id);

    let isIphoneX = app.globalData.isIphoneX;
    // console.log("app.globalData",app.globalData);
    that.setData({
      isIphoneX: isIphoneX,
    });

    that.tagxx(that.data.tagname);
    // this.lc1(this.data.tagname);

    // wx.getSystemInfo({
    //   success: (res) => {
    //     let ww = res.windowWidth;
    //     let wh = res.windowHeight;
    //     let imgWidth = ww * 0.48;
    //     let scrollH = wh;
    //     that.setData({
    //       scrollH: scrollH,
    //       imgWidth: imgWidth,
    //     });
    //     //加载首组图片
    //     that.loadImages();
    //   },
    // });
  },

  onImageLoad: function (e) {
    let imageId = e.currentTarget.id;
    let oImgW = e.detail.width; //图片原始宽度
    let oImgH = e.detail.height; //图片原始高度
    let imgWidth = this.data.imgWidth; //图片设置的宽度
    let scale = imgWidth / oImgW; //比例计算
    let imgHeight = oImgH * scale; //自适应高度
    let images = this.data.images;
    let imageObj = null;
    for (let i = 0; i < images.length; i++) {
      let img = images[i];
      if (img.id === imageId) {
        imageObj = img;
        break;
      }
    }

    if (imageObj != null) {
      imageObj.height = imgHeight;

      let loadingCount = this.data.loadingCount - 1;
      let col1 = this.data.col1;
      let col2 = this.data.col2;
      //判断当前图片添加到左列还是右列
      if (col1H <= col2H) {
        col1H += imgHeight;
        col1.push(imageObj);
      } else {
        col2H += imgHeight;
        col2.push(imageObj);
      }

      let data = {
        loadingCount: loadingCount,
        col1: col1,
        col2: col2,
      };
      //当前这组图片已加载完毕，则清空图片临时加载区域的内容
      if (!loadingCount) {
        data.images = [];
      }
      this.setData(data);
      // console.log("col1", this.data.col1);
      // console.log("col2", this.data.col2);
    }
  },

  async loadImages() {
    if (this.data.gxsl == 0) {
      return;
    }

    this.setData({
      page: this.data.page + 1,
      loadingx: true,
    });
    let fytemp = {
      page: this.data.page,
      keywordsLike: this.data.tagname,
      pageSize: this.data.gxsl,
    }

    if (this.data.tagname == '配色' || this.data.tagname == '中国传统色') {
      fytemp.pageSize = 30
    }

    let res = await WXAPI.cmsArticles(fytemp);


    let that = this;
    if (res.data) {
      let a = [];
      let b = res.data.result;

      b.forEach((x) => {

        let c = x.keywords;
        let lsa = c.split("、");
        x.keywords_x = c.split("、");
        if (x.video) {
          let av = x.video;

          av = av.split(",");
          if (av[0]) {
            x.video1 = av[0];
          }
          if (av[1]) {
            x.video2 = av[1];
          }
          if (av[2]) {
            x.video3 = av[2];
          }

          if (av[3] == "copy") {
            x.color = av[2];
          }

          if (av[3]) {
            x.video4 = av[3];
          }

          if (av[4]) {
            x.video5 = av[4];
          }

          // images[i].video = av;
        }

        // console.log(x.keywords);
        x.sfxs = this.isShow(x.keywords);
        lsa.forEach(function (e) {
          if (e.toLowerCase() == that.data.tagname.toLowerCase()) {
            a.push(x);
          }
        });







      });


      console.log("aaaaaaaaaa", a);

      if (a.length == 0 || (that.data.lc1).length < 8) {
        that.loadImages();
      }
      that.setData({
        lc1: a,
        images: a,
      });

      // console.log("lcsj",that.data.lc1);

      let images = [...new Set(that.data.lc1)];

      // console.log("images", images);

      let baseId = "img-" + +new Date();
      for (let i = 0; i < images.length; i++) {
        images[i].ids = images[i].id;
        images[i].id = baseId + "-" + i;
      }
      that.setData({
        loadingCount: images.length,
        images: images,
      });

      console.log("images2222222", images);

      if (images.length < 10) {
        that.setData({
          ddl: true,
        });
      } else {
        that.setData({
          loadingx: false,
        });
      }
    } else {
      // console.log(111111111);
      if (this.data.page > 1) {
        // console.log(333333);
        this.setData({
          ddl: true,
          my: false,
          loadingx: false,
        });
      } else {
        // console.log(2222222);
        this.setData({
          my: true,
          ddl: false,
          loadingx: false,
        });
      }

      return;
    }
  },

  // 分类信息
  async tagxx(a, x) {
    // console.log("sdf",a);

    var that = this;


    let resxx = await WXAPI.cmsPage(a);
    // console.log("tagxxtagxxtagxxtagxxtagxxtagxxtagxxtagxxtagxx111",resxx);
    if (resxx.data) {
      // console.log("tagxxtagxxtagxxtagxxtagxxtagxxtagxxtagxxtagxx222",resxx.data);
      let temp = resxx.data.extJson;
      if (temp.LC1_1) {
        temp.LC1_1 = temp.LC1_1.split("、");
      }
      if (temp.LC1_1a) {
        temp.LC1_1a = temp.LC1_1a.split("、");
      }
      if (temp.LC2_2) {
        temp.LC2_2 = temp.LC2_2.split("、");
      }
      if (temp.LC2_2a) {
        temp.LC2_2a = temp.LC2_2a.split("、");
      }
      if (temp.LC3_3) {
        temp.LC3_3 = temp.LC3_3.split("、");
      }
      if (temp.LC3_3a) {
        temp.LC3_3a = temp.LC3_3a.split("、");
      }
      if (temp.LC4_4) {
        temp.LC4_4 = temp.LC4_4.split("、");
      }
      if (temp.LC4_4a) {
        temp.LC4_4a = temp.LC4_4a.split("、");
      }
      if (temp.LC5_5) {
        temp.LC5_5 = temp.LC5_5.split("、");
      }
      if (temp.LC5_5a) {
        temp.LC5_5a = temp.LC5_5a.split("、");
      }
      if (temp.LC6_6) {
        temp.LC6_6 = temp.LC6_6.split("、");
      }
      if (temp.LC6_6a) {
        temp.LC6_6a = temp.LC6_6a.split("、");
      }
      if (temp.LC7_7) {
        temp.LC7_7 = temp.LC7_7.split("、");
      }
      if (temp.LC7_7a) {
        temp.LC7_7a = temp.LC7_7a.split("、");
      }
      if (temp.LC8_8) {
        temp.LC8_8 = temp.LC8_8.split("、");
      }
      if (temp.LC8_8a) {
        temp.LC8_8a = temp.LC8_8a.split("、");
      }
      if (temp.LC9_9) {
        temp.LC9_9 = temp.LC9_9.split("、");
      }
      if (temp.LC9_9a) {
        temp.LC9_9a = temp.LC9_9a.split("、");
      }
      if (temp.LC10_10) {
        temp.LC10_10 = temp.LC10_10.split("、");
      }
      if (temp.LC10_10a) {
        temp.LC10_10a = temp.LC10_10a.split("、");
      }

      console.log(temp);

      that.setData({
        // listfootimg:resxx.data.extJson.listfootimg,
        listfoota: resxx.data.extJson.listfoota,
        jdy: resxx.data.extJson,
        newfoota: resxx.data.extJson.newfoota,
      });

      if (resxx.data.extJson.dm) {
        that.setData({
          dm: resxx.data.extJson.dm
        });
      }

      if (resxx.data.extJson.gx != undefined) {

        that.setData({
          gxsl: resxx.data.extJson.gx
        });

      }



      wx.getSystemInfo({
        success: (res) => {
          let ww = res.windowWidth;
          let wh = res.windowHeight;
          let imgWidth = ww * 0.48;
          let scrollH = wh;
          that.setData({
            scrollH: scrollH,
            imgWidth: imgWidth,
          });
          //加载首组图片
          that.loadImages();
        },
      });


      // console.log(that.data.listfootimg,that.data.listfoota);
    } else {
      that.setData({
        jdy: {
          zdy: false
        },

      });
      wx.getSystemInfo({
        success: (res) => {
          let ww = res.windowWidth;
          let wh = res.windowHeight;
          let imgWidth = ww * 0.48;
          let scrollH = wh;
          that.setData({
            scrollH: scrollH,
            imgWidth: imgWidth,
          });
          //加载首组图片
          that.loadImages();
        },
      });
    }

    if (that.data.type == "d1" || x == "d1") {
      // 判断是否顶级点击

      let b = a;
      let ba = a + "a";
      //  console.log("x1",b);
      //  console.log("x12",ba);

      let r = that.data.tagxx.extJson[b];
      r = r.split("、");

      let ra = that.data.tagxx.extJson[ba];
      ra = ra.split("、");
      //  console.log(r);
      //  console.log(ra);
      that.setData({
        r: r,
        ra: ra,
      });
    } else if (that.data.type == undefined) {
      // 判断是否第一次进去的

      let res = await WXAPI.cmsPage(a);

      if (res.data) {
        // console.log("tagxxtagxxtagxxtagxxtagxxtagxxtagxxtagxxtagxx",res.data);

        that.setData({
          tagxx: res.data,
        });

        var top = "";
        var topa = "";

        // console.log("res.data.extJson['top']",res.data.extJson['top']);
        if (res.data.extJson["top"]) {
          top = res.data.extJson["top"];

          if (top.indexOf("、") != -1) {
            top = top.split("、");
          }

          that.setData({
            top: top,
          });


          // console.log("xxxxxxxxaaaaa",that.data.top);
          let b = that.data.top[0];
          console.log("xxxxxxxx", b);
          console.log(
            "res.data.extJson[b]res.data.extJson[b]",
            res.data.extJson[b]
          );
          if (res.data.extJson[b]) {
            let r = res.data.extJson[b];
            if (r.indexOf("、") != -1) {
              r = r.split("、");
            }
            that.setData({
              r: r,
            });
          }
        }

        // console.log("res.data.extJson['topa']",res.data.extJson['topa']);

        if (res.data.extJson["topa"]) {
          topa = res.data.extJson["topa"];

          if (topa.indexOf("、") != -1) {
            topa = topa.split("、");
          }
          that.setData({
            topa: topa,
          });

          let ba = top[0] + "a";

          if (res.data.extJson[ba]) {
            let ra = res.data.extJson[ba];
            if (ra.indexOf("、") != -1) {
              ra = ra.split("、");
            }

            that.setData({
              ra: ra,
            });
          }
        }
      }
    } else {
      // 左侧点击
    }
  },

  async lc1(a) {
    let res = await WXAPI.cmsArticles({
      page: this.data.page,
      pageSize: 35,
    });

    if (res.data) {
      this.setData({
        lc1: res.data.result,
      });
      // console.log("lcsj",this.data.lc1);
    }
  },

  toliebiao(e) {
    let tag_id = e.currentTarget.dataset.id;
    if (tag_id.indexOf("http") == 0) {
      let site = tag_id.lastIndexOf("/");
      tag_id = tag_id.substring(site + 1, tag_id.length);
    }

    wx.vibrateShort();

    // console.log(tag_id);
    wx.navigateTo({
      url: `/pages/taglist/index?id=${tag_id}`,
    });
  },

 vip_zf() {

    var that = this;

 that.setData({

   money: "9.9",
        nextAction: '{"type":6,"userLevelPriceId":"377","isAutoRenew":true,"remark":"阅读版"}',
        payName: "阅读版",
        remark: "阅读版",
        token: wx.getStorageSync('token')


        //    money: "99",
        // nextAction: '{"type":6,"userLevelPriceId":"230","isAutoRenew":true,"remark":"提升版"}',
        // payName: "提升版",
        // remark: "提升版",
        // token: wx.getStorageSync('token')
          })



    const postData = {
      token: wx.getStorageSync('token'),
      money: that.data.money,
      remark: that.data.remark,
      payName: that.data.payName,
      nextAction: that.data.nextAction
    }
    console.log("postDatapostData", postData);






    WXAPI.wxpay(postData).then(function (res) {
      if (res.code == 0) {
        // 发起支付
        wx.requestPayment({
          timeStamp: res.data.timeStamp,
          nonceStr: res.data.nonceStr,
          package: res.data.package,
          signType: res.data.signType,
          paySign: res.data.paySign,
          fail: function (aaa) {
            console.error(aaa)
            wx.showToast({
              title: '支付失败:' + aaa
            })
          },
          success: function () {
            // 提示支付成功
            wx.showToast({
              title: '支付成功'
            })
            // 刷新页面
            that.onLoad();
            // wx.redirectTo({
            //   url: redirectUrl
            // });
          }
        })
      } else {
        wx.showModal({
          title: '微信支付',
          content: "网络链接失败，请重试",
          showCancel: false
        })
      }
    })

  },


  myy(e) {

    let hyid = e;

     if (hyid == 1) {
      this.setData({
        tf: true,
      });

    } else {
    // console.log("sssssssssssss",id);
    wx.setStorageSync("vipid", hyid);

    wx.switchTab({
      url: "/pages/coupons/hy",
    });
  }

    // this.setData({
    //   vtt: true,
    // });
    // setTimeout(function () {
    //   // console.log("没有开通");

    //   // wx.navigateTo({
    //   //   url: `/pages/coupons/hy2`,
    //   // });

    //   wx.switchTab({
    //     url: '/pages/coupons/hy',
    //   });
    // }, 2000);
  },

  fzys(e) {
    wx.setClipboardData({
      data: e,//这是复制的内容
      success(res) {
        wx.getClipboardData({
          success(res) {
            wx.showToast({
              title: '色值复制成功',
            })
          }
        })
      }
    })
  },

  async toxiangqing(e) {
    let vip = e.currentTarget.dataset.vip;
    const tag_id = e.currentTarget.dataset.ids;
    let copy = e.currentTarget.dataset.copy;

    let res = await WXAPI.userDetail(wx.getStorageSync("token"));
    // console.log(res);
    wx.vibrateShort();

    if (vip == "") {
      if (copy == "copy") {
        this.fzys(e.currentTarget.dataset.color);
      } else {
        wx.navigateTo({
          url: `/pages/xiangqing/index?id=${tag_id}&dm=${this.data.dm}`,
        });
      }

    } else {
      if (!res.data.userLevel) {
        // 没有开通
        // console.log("没有开通");
        this.myy(vip - 1);
      } else {
        //判断等级
        if (res.data.userLevel.level >= vip) {
          // 等级够了
          if (copy == "copy") {
            this.fzys(e.currentTarget.dataset.color);
          } else {
            wx.navigateTo({
              url: `/pages/xiangqing/index?id=${tag_id}`,
            });
          }

        } else {
          // 等级不够
          // console.log("等级不够");
          this.myy(vip - 1);
        }
      }
    }
  },

  onShow: function (e) {
    this.setData({
      vtt: false,
      navHeight: APP.globalData.navHeight,
      navTop: APP.globalData.navTop,
      windowHeight: APP.globalData.windowHeight,
      menuButtonObject: APP.globalData.menuButtonObject, //小程序胶囊信息
      f2hh: APP.globalData.windowHeight - APP.globalData.navHeight - 50,
    });

    var _this = this;
    if (typeof _this.getTabBar === "function" && _this.getTabBar()) {
      _this.getTabBar().setData({
        selected: 0,
      });
    }
  },

  onPageScroll(e) {
    let scrollTop = this.data.scrollTop;
    this.setData({
      scrollTop: e.scrollTop,
    });
  },

  onShareTimeline: function () {
    return {
      title: this.data.tagname,
      query: 'id=' + this.data.id + '&dm=' + this.data.dm,

    }
  },

  onShareAppMessage: function () {
    return {
      title:this.data.tagname + wx.getStorageSync("share_profile"),
      path: "/pages/taglist/index?id=" + this.data.tagname + '&dm=' + this.data.dm,
    };
  },

  goSearch() {
    wx.navigateTo({
      url: "/pages/search/index",
    });
  },
  goNotice(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: "/pages/notice/show?id=" + id,
    });
  },

  closePop() {
    this.setData({
      posterShow: false,
    });
  },


  //   const encoder = new TextEncoder();
  // const decoder = new TextDecoder();

  // const text = "你好，世界！";
  // const bytes = encoder.encode(text);        // 字符串 → 字节
  // const decoded = decoder.decode(230%252C156%252C180%252C228%252C189%252C156);     // 字节 → 字符串

  // console.log(decoded); // "你好，世界！"

  base64EncodeUsingAPI2(input) {

    // const decoder = new TextDecoder();

    // const decoded = decoder.decode(input);     // 字节 → 字符串

    // return decoded

    return Base64.decode(input);//解码


  },
  base64EncodeUsingAPI(input) {
    // // 使用 TextEncoder 将字符串转换为 UTF-8 字节
    // const utf8Bytes = new TextEncoder().encode(input);

    // // 将字节数组转换为 Base64 字符串
    // return utf8Bytes;

    return Base64.encode(input); //加密


    // const encoder = new TextEncoder();

    // const bytes = encoder.encode(input);        // 字符串 → 字节

    // return bytes



  },



  async drawSharePic() {
    const _this = this;
    console.log("qrcodeRes222")
    console.log("_this.data.xx.info.id", this.base64EncodeUsingAPI(_this.data.tagname) + ',' + wx.getStorageSync('uid'));
    const qrcodeRes = await WXAPI.wxaQrcode({
      scene: this.base64EncodeUsingAPI(_this.data.tagname),
      page: "pages/taglist/index",
      is_hyaline: true,
      autoColor: true,
      expireHours: 1,
    });
    console.log("qrcodeRes", qrcodeRes)
    if (qrcodeRes.code != 0) {
      wx.showToast({
        title: qrcodeRes.msg,
        icon: "none",
      });
      return;
    }
    // console.log("qrcodeRes",qrcodeRes);
    const qrcode = qrcodeRes.data;
    const pic = _this.data.col1[0].pic?_this.data.col1[0].pic:"https://www.mlito.com/wp-content/uploads/fx_zdy5_4.png";
    console.log("pic", pic);

    wx.getImageInfo({
      src: pic,
      success(res) {
        const height = (490 * res.height) / res.width;
        _this.drawSharePicDone(height, qrcode);
      },
      fail(e) {
        console.error(e);
      },
    });
  },
  drawSharePicDone(picHeight, qrcode) {
    // console.log("picHeight, qrcode",picHeight, qrcode);
    const _this = this;
    const _baseHeight = 74 + (picHeight + 120);
    this.setData(
      {
        posterConfig: {
          width: 750,
          height: picHeight + 660,
          backgroundColor: "#fff",
          debug: false,
          blocks: [
            {
              x: 76,
              y: 74,
              width: 604,
              height: picHeight + 120,
              borderWidth: 2,
              borderColor: "#c2aa85",
              borderRadius: 8,
            },
          ],
          images: [
            {
              x: 133,
              y: 133,
              url:_this.data.col1[0].pic?_this.data.col1[0].pic:"https://www.mlito.com/wp-content/uploads/fx_zdy5_4.png", // 商品图片
              width: 490,
              height: picHeight,
            },
            {
              x: 76,
              y: _baseHeight + 199,
              url: qrcode, // 二维码
              width: 222,
              height: 222,
            },
          ],
          texts: [
            {
              x: 375,
              y: _baseHeight + 80,
              width: 650,
              lineNum: 2,
              text: _this.data.tagname,
              textAlign: "center",
              fontSize: 40,
              color: "#333",
            },
            // {
            //   x: 375,
            //   y: _baseHeight + 180,
            //   text: '￥' + _this.data.goodsDetail.basicInfo.minPrice,
            //   textAlign: 'center',
            //   fontSize: 50,
            //   color: '#e64340'
            // },
            {
              x: 352,
              y: _baseHeight + 320,
              text: "长按识别小程序码",
              fontSize: 28,
              color: "#999",
            },
          ],
        },
      },
      () => {
        Poster.create();
      }
    );
  },
  onPosterSuccess(e) {
    // console.log('success:', e)
    this.setData({
      posterImg: e.detail,
      showposterImg: true,
    });
  },
  onPosterFail(e) {
    console.error("fail:", e);
  },
  savePosterPic() {
    const _this = this;
    wx.saveImageToPhotosAlbum({
      filePath: this.data.posterImg,
      success: (res) => {
        wx.showModal({
          content: "已保存到手机相册",
          showCancel: false,
          confirmText: "知道了",
          confirmColor: "#333",
        });
      },
      complete: () => {
        _this.setData({
          showposterImg: false,
        });
      },
      fail: (res) => {
        wx.showToast({
          title: res.errMsg,
          icon: "none",
          duration: 2000,
        });
      },
    });
  },
});
